import BaseApi from '../BaseApi';

const controller = "/charge";

export default {

    statistics(condition) {
        return this.requestPost(controller, "/statistics", condition);
    },
    statisticsAll(condition) {
        return this.requestPost(controller, "/statisticsAll", condition);
    },
    exportStatisticsExcel(condition) {
        return this.requestDownloadGet(controller, "/exportStatisticsExcel", condition);
    },

    getArrearsTotal(condition) {
        return this.requestPost(controller, "/statisticsCount", condition);
    },

    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    }

}
